home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / odosrc / diskinf.frm < prev    next >
Text File  |  1995-05-08  |  3KB  |  108 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1980
  5.    ClientLeft      =   1320
  6.    ClientTop       =   2265
  7.    ClientWidth     =   2775
  8.    Height          =   2385
  9.    Left            =   1260
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1980
  13.    ScaleWidth      =   2775
  14.    Top             =   1920
  15.    Width           =   2895
  16.    Begin CommandButton Command3 
  17.       Caption         =   "Free Res"
  18.       Height          =   495
  19.       Left            =   120
  20.       TabIndex        =   6
  21.       Top             =   1320
  22.       Width           =   1095
  23.    End
  24.    Begin TextBox Text1 
  25.       Height          =   285
  26.       Left            =   2040
  27.       TabIndex        =   1
  28.       Text            =   "1"
  29.       Top             =   840
  30.       Width           =   375
  31.    End
  32.    Begin CommandButton Command2 
  33.       Caption         =   "FreeMem"
  34.       Height          =   495
  35.       Left            =   120
  36.       TabIndex        =   5
  37.       Top             =   720
  38.       Width           =   1095
  39.    End
  40.    Begin TextBox Text2 
  41.       Height          =   285
  42.       Left            =   2040
  43.       TabIndex        =   2
  44.       Text            =   "3"
  45.       Top             =   240
  46.       Width           =   375
  47.    End
  48.    Begin CommandButton Command1 
  49.       Caption         =   "DiskInfo"
  50.       Default         =   -1  'True
  51.       Height          =   495
  52.       Left            =   120
  53.       TabIndex        =   0
  54.       Top             =   120
  55.       Width           =   1095
  56.    End
  57.    Begin Label Label2 
  58.       Caption         =   "Info:"
  59.       Height          =   255
  60.       Left            =   1440
  61.       TabIndex        =   4
  62.       Top             =   840
  63.       Width           =   495
  64.    End
  65.    Begin Label Label1 
  66.       Caption         =   "Disk:"
  67.       Height          =   255
  68.       Left            =   1440
  69.       TabIndex        =   3
  70.       Top             =   240
  71.       Width           =   495
  72.    End
  73. End
  74. Declare Function DiskInfo& Lib "DISKINFO.DLL" (ByVal DriveNum As Integer, ByVal InfoType As Integer)
  75. Declare Function GetFreeMem& Lib "DISKINFO.DLL" ()
  76. Declare Function GetFreeRes% Lib "DISKINFO.DLL" (ByVal InfoType As Integer)
  77.  
  78. Sub Command1_Click ()
  79.     z% = Val(Text1.text)
  80.     y% = Val(text2.text)
  81.     x& = DiskInfo&(y%, z%)
  82.     MsgBox Format$(x&, "###,###,###")
  83.  
  84. End Sub
  85.  
  86. Sub Command2_Click ()
  87.     x& = GetFreeMem&() \ 1024
  88.     MsgBox "Free Memory = " + Format$(x&, "#,###") + "K"
  89. End Sub
  90.  
  91. Sub Command3_Click ()
  92.     z% = Val(Text1.text)
  93.     x% = GetFreeRes%(z%)
  94.     res$ = ""
  95.     Select Case z%
  96.         Case 0
  97.             res$ = " [System]"
  98.         Case 1
  99.             res$ = " [GDI]"
  100.         Case 2
  101.             res$ = " [User]"
  102.     End Select
  103.  
  104.     MsgBox Format$(x%, "##") + "% Free Resources" + res$
  105.     
  106. End Sub
  107.  
  108.